<!--
 * @Author: Dorange.Wang
 * @Date: 2021-04-22 19:53:51
 * @LastEditors: your name
 * @LastEditTime: 2021-04-25 09:37:20
 * @Description: file content
-->
<template lang="html">

  <el-dialog
    :visible="showVisible"
    center
    :show-close="false"
    width="600px"
    class="code-editor-dialog"
  >
    <div class="b g3 f16 tl" slot="title">
      <div class="ks-row-between pl15 pr15">
        <span>{{ title }}</span>
        <span
          class="el-icon-close g9 f26 poi"
          @click="showVisible = false"
        ></span>
      </div>
    </div>

    <div class="pl30 pr30">
      <VueElementCron ref="VueElementCron"/>
    </div>

    <div slot="footer" class="tr">
      <el-button @click="showVisible = false">取 消</el-button>
      <el-button type="primary" @click="submit">确 定</el-button>
    </div>

  </el-dialog>

</template>

<script>
import VueElementCron from 'vue-element-cron'
export default {
  name: 'CronModal',
  components: {
    VueElementCron
  },
  data () {
    return {
      title: '',
      showVisible: false,
      callback: null
    }
  },

  created () {},

  computed: {},

  methods: {
    open (data = {}, callback) {
      this.title = data.title
      this.callback = callback
      this.showVisible = true
    },

    submit () {
      const value = this.$refs.VueElementCron.getCron()
      this.callback && this.callback(value)
      this.showVisible = false
    }
  }

}
</script>

<style lang="css">
</style>
